package com.exsun.gateway.jt809.kafka.gps;

import com.exsun.gateway.jt809.data.Interface.IGpsHandle;
import com.exsun.gateway.jt809.data.PushData;
import com.exsun.gateway.jt809.handler.SendMgrHandler;
import exsun.jt808.data.jt809_data.BasicVehicleInfo;
import exsun.jt808.data.upload_data.GpsData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class GpsHandle {
    @Autowired
    private SendMgrHandler sendMgrHandler;

    public List<PushData> getPushData(IGpsHandle handle, GpsData positionInfo, BasicVehicleInfo basicVehicleInfo){
        Object convertData =  handle.convert(positionInfo, basicVehicleInfo);
        return handle.getPushData(convertData, sendMgrHandler);
    }
}
